<extend name="Public/base"/>

<block name="body">
    <div class="main-title">
        <h2>{$_title}</h2>
    </div>
    <notempty name="category" >
    	<form action="{:U('Fund/editFundCat')}" method="post" class="form-horizontal">
    		<input type="hidden" name="id" value="{$category.id}" />
    <else />
	    <form action="{:U('Fund/addFundCat')}" method="post" class="form-horizontal">
    </notempty>
        <div class="form-item">
            <label class="item-label">分类名称<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="name" value="{$category.name|default=''}">
            </div>
        </div>
        
        <div class="form-item">
            <label class="item-label">父级分类<span class="check-tips"></span></label>
            <div class="controls">
            	<select name="parent_id" class="input-large">
            		<option value="-1">无</option>
            		<notempty name="list">
            			<foreach name="list" key="key" item="val">
	            			<if condition="$val['id'] eq $category['parent_id']">
			            		<option value="{$val.id}" selected>{$val.name}</option>
			            	<else />
	            				<option value="{$val.id}">{$val.name}</option>
	            			</if>
            			</foreach>
            		</notempty>
            	</select>
            </div>
        </div>
        
        <div class="form-item">
            <label class="item-label">分类描述<span class="check-tips"></span></label>
            <div class="controls">
            	<textarea style="width:900px;height:300px;padding:5px;" class="input-large" name="description">{$category.description|default=''}</textarea>
            </div>
        </div>
        
        <div class="form-item">
            <button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确 定</button>
            <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
        </div>
    </form>
</block>

<block name="script">
    <script type="text/javascript">
        //导航高亮
        highlight_subnav('{:U('Fund/fundCatList')}');
    </script>
</block>
